next
Round
Technologies
Experiences
Contribute
Login
next
Round
Technologies
Experiences
Contribute
Login
Question Loading...
File Operations
1. How do you read a file synchronously in Node.js?
Level: Expert | Frequency: High
2. How do you read a file asynchronously in Node.js?
Level: Expert | Frequency: High
3. Explain how to write to a file in Node.js?
Level: Expert | Frequency: High
4. What is the purpose of the `fs.exists()` method in Node.js?
Level: Expert | Frequency: High
5. How can you delete a file in Node.js?
Level: Expert | Frequency: High
6. What is the purpose of the `fs.createReadStream()` and `fs.createWriteStream()` methods in Node.js?
Level: Expert | Frequency: High
7. How can you check if a given path is a file or a directory in Node.js?
Level: Expert | Frequency: High
8. Explain the difference between `fs.readFile()` and `fs.createReadStream()` for reading files in Node.js.
Level: Expert | Frequency: High
9. How can you append data to an existing file in Node.js?
Level: Expert | Frequency: High
10. How can you recursively list all files and directories in a given directory using Node.js?
Level: Expert | Frequency: High
11. What is the purpose of the `fs.mkdir()` method in Node.js, and how can you create directories with it?
Level: Expert | Frequency: High
12. How can you rename a file or directory in Node.js?
Level: Expert | Frequency: High
13. Explain what the `fs.readdir()` method is used for in Node.js.
Level: Expert | Frequency: High
14. What is the purpose of the `fs.rmdir()` method in Node.js, and how can you delete a directory with it?
Level: Expert | Frequency: High
15. What is the difference between `fs.unlink()` and `fs.unlinkSync()` in Node.js?
Level: Expert | Frequency: High
16. How can you watch for file changes in a directory using Node.js?
Level: Expert | Frequency: High
All Topics
Event Loop
Buffers
Streams
Events
Modules
Worker Threads
File Operations
Threads
Performance Optimisation
Websockets
Time functions
Clusters
Crypto